package com.MoCh.www;

import java.util.Random;
import java.util.Scanner;

public class YanZh {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入要生成验证码的位数");
        int i = sc.nextInt();
        String p = Product(i);
        System.out.println(p);
    }

    public static String Product(int i) {
        String p = "";
        String k = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
        Random r = new Random();
        for (int j = 0; j < i; j++) {
            int d = r.nextInt(k.length()    );
            char c = k.charAt(d);
            p += c;
        }
        return p;
    }

}
